package org.javaboy.demo.p2;

import org.javaboy.demo.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
public class JavaConfig {

    @Bean
    @MyProfile(env = "dev")
    DataSource devDs() {
        return new DataSource("jdbc:mysql:///dev", "dev", "dev");
    }

    @Bean
    @MyProfile(env = "prod")
    DataSource prodDs() {
        return new DataSource("jdbc:mysql:///prod", "prod", "prod");
    }
}
